﻿@model List<LAPI.Data.Model.Deporte>
           
@{
    Int32 numeroRegistros = 0;
    if (Model != null)
    {
        numeroRegistros = Model.Count;
    }
        
    WebGrid grid = null;
    if (numeroRegistros > 0) {
        grid = new WebGrid(Model, rowsPerPage: numeroRegistros);
    } else {
        grid = null;
    }
}

<div class="row">
        @if (grid != null)
        {
            @grid.GetHtml(
            fillEmptyRows: true,
            tableStyle: "table table-striped table-bordered",
            mode: WebGridPagerModes.All,
            footerStyle: "badge",

            columns: grid.Columns(
                         grid.Column("idDeporte", style: "", header: "#", canSort: false),
                         grid.Column("descripcion", style: "", header: "Nombre Deporte", canSort: false),
                         grid.Column("color", style: "", header: "Color Etiqueta", canSort: false, format: @<text><span class="span1" style="background-color: @item.color">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></text>  ),                        
                         grid.Column(columnName: "",
                                     style: "",
                                     header: "Acciones",
                                     format:
                                                @<text>                                   
                                                    <a class="btn btn-info" rel="tooltip" title="Editar Deporte" href="@Url.Action(actionName: "Editar", controllerName: "Deporte", routeValues: new { id = @item.idDeporte })">
                                                        <i class="icon-edit"></i>                                       
                                                    </a>    
                                                                             
                                                    <a class="btn btn-danger" rel="tooltip" title="Eliminar Deporte" href="@Url.Action(actionName: "Eliminar", controllerName: "Deporte", routeValues: new { id = @item.idDeporte })" onclick="javascript:return confirmacionEliminar(this, 'deporte','@Url.Action(controllerName: "Deporte", actionName: "Buscar")');">
                                                        <i class="icon-trash"></i>                                        
                                                    </a>                                     
                                                    
                                                </text>,
                                                                             canSort: false)
                                         )
                                 )  
        }
        else
        {
            <div class="span8 offset1 label label-info">               
                No se han encontrado datos...
            </div>
        }
</div>